Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport release-1.31] Fix deletion of persistent data with k0s reset #5301

Merged
merged 3 commits into from
Dec 5, 2024

Conversation

k0s-bot
Copy link

@k0s-bot k0s-bot commented Nov 29, 2024

Automated backport to release-1.31, triggered by a label in #5193.
See #4318.

ncopa and others added 3 commits November 29, 2024 12:09
Make sure that we don't have anything mounted under those directories so
we don't delete persistent data.

We do this py parsing /proc/mounts in reverse order as it is listed in
mount order, and then we unmount anything that is under our directories
before we delete them.

Don't umount datadir itself if it is on a separate partition/mount

Fixes #4318

Signed-off-by: Natanael Copa <[email protected]>
(cherry picked from commit 7ab81aa)
Add a script to the reset integration test that tries to clutter the
data directory by placing files and directories with odd permissions,
adding symlinks to stuff outside the data directory, and adding bind
mounts in various ways.

This is to prove that k0's reset will never delete anything that is not
beneath the data directory.

Signed-off-by: Tom Wieczorek <[email protected]>
(cherry picked from commit 2897c35)
k0s reset will delete any leftovers safely when deleting directories.

Signed-off-by: Natanael Copa <[email protected]>
(cherry picked from commit 12aa906)
@k0s-bot k0s-bot requested a review from a team as a code owner November 29, 2024 12:09
@k0s-bot k0s-bot requested review from makhov and twz123 November 29, 2024 12:09
@twz123 twz123 merged commit 4617bac into release-1.31 Dec 5, 2024
92 checks passed
@twz123 twz123 deleted the backport-5193-to-release-1.31 branch December 5, 2024 09:01
@twz123 twz123 added the bug Something isn't working label Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants